<?php

/*
 * Copyright (C) 2010 TopCoder Inc., All Rights Reserved.
 */
namespace protocol\translation\framework\services;

require_once('PHPUnit/Framework.php');
require_once('log4php/Logger.php');
require_once('protocol/translation/framework/services/base/Converter.php');
require_once('protocol/translation/framework/services/base/SMPP_JSON_Converter.php');

use protocol\translation\framework\services\base\SMPP_JSON_Converter;

/**
 * <p>
 * Demonstrates basic usage of the Alcatel-Lucent Protocol Translation Framework
 * component.
 * </p>
 *
 * @author hpana, akinwale
 * @version 1.0
 */
class DemoTests extends \PHPUnit_Framework_TestCase {
    /**
     * <p>
     * Demonstrate use of the Converter using the SMPP_JSON_Converter implementation.
     * </p>
     */
    public function testDemo() {
        // Create a new instance
        $converter = new SMPP_JSON_Converter();

        // Convert to JSON
        $json = $converter->convertTo(array("senderAddress" => "Some Addr"), "query delivery status");

        // Convert from name/value parameter pairs
        $data = $converter->convertFrom(
            "notifyURL=http%3A%2F%2Fnotify&callbackData=CallbackData", "subscribeToSMSDeliveryNotifications"
        );
        // Get the notify URL
        $notifyUrl = $data["notifyURL"]; // http://notify

        // Get the callback data
        $callbackData = $data["callbackData"]; // CallbackData
    }
}

?>